Insetting Dashes
You can use a number of methods to change the placement of the dash shape relative to the dashed contour. For example, you can
These two methods produce substantially different results. For example, if you inset the pen placement in the example from the previous section by adding the call
- set the inside-frame style attribute (
gxInsideFrameStyle
) or outside-frame style (gxOutsideFrameStyle
) attribute of the style object containing the dash information so that QuickDraw GX places the dashes on the inside or outside of the contours- change the geometry of the dash shape so that QuickDraw GX changes the placement the dash shape correspondingly when dashing the shape
GXSetShapeStyleAttributes(aCircleShape, gxInsideFrameStyle);to theCreateADashedCircle
sample function in Listing 3-14 on page 3-70, QuickDraw GX automatically adjusts the number and spacing of the dashes to fit the smaller circle, as shown in Figure 3-65.Figure 3-65 Circle with diamond dashes inset
In this case, the number of dashes has been drastically reduced. If you want to keep the number of dashes constant, but move them towards the center of the circle, change the geometry of the dash shape instead of insetting the pen. For example, you can alter the diamond geometry from the
CreateDashedCircle
sample function by translating it up 30 points in the y-coordinate direction using this defintion:
static long diamondGeometry[] = {1, /* number of contours */ 4, /* number of points */ ff(0), ff(50), ff(15), ff(30), ff(0), -ff(10), -ff(15), ff(30)};In this case, if you do not inset the pen of the circle shape, the resulting shape maintains the greater number of dashes, but fits within the smaller circle, as shown in Figure 3-66.Figure 3-66 Circle with diamond dashes moved toward the center
The sections "The Dash Structure" on page 3-103 and "Dash Attributes" on page 3-105 describe the dash structure and dash attributes in more detail, and the section "Getting and Setting Dashes" beginning on page 3-134 describes the functions you can use to manipulate dashes.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help